package com.xyoto.takeawayUser.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;

/**
 * @author Administrator
 */
@ApiModel("保存用户地址")
@Data
public class SaveUserAddrDTO {

    @ApiModelProperty("用户名")
    @NotNull(message = "用户名不能为空")
    private String username;

    @ApiModelProperty("手机号")
    @NotNull(message = "手机号不能为空")
    private String phone;

    @ApiModelProperty("地址")
    @NotNull(message = "地址不能为空")
    private String addr;

    @ApiModelProperty("详细地址")
    @NotNull(message = "详细地址不能为空")
    private String detailAddr;

    @ApiModelProperty("是否默认地址（1-默认，2-不默认）")
    @Range(min = 1, max = 2, message = "参数异常")
    private Short defaultAddr;

}
